from PyQt5.QtCore import QUrl
from PyQt5.QtWebEngineWidgets import QWebEngineView
class CraBrowser(QWebEngineView):

    # def __init__(self):
    #     self.status=True
    #     self.htmlStr=None
    #     self.parent=None

    def __init__(self, parent=None):
        # self.status=True
        # self.htmlStr=None
        super().__init__(parent)
        # self.page().load(QUrl("http://www.baidu.com"))
        # self.loadFinished.connect(self.toHtmlStr)
        # self.page().toHtml(self.toHtmlStr)

    # def loadUrl(self,url):
    #     super().load(url)

    # def initView(self,parent=None):
    #     self.parent=parent
    #     super().__init__(parent)
    #
    # def clearData(self):
    #     self.status=True
    #     self.htmlStr=None
    def toHtmlStr(self):
        print(self.page().toHtml(self.browserController.htmlStr))

# class tCraBrowser():
#     def __init__(self):
#         self.thread = threading.Thread(target=self.run,name="aaaa")
#
#     def run(self):
#         while(True):
#             time.sleep(3)
#             print("aaaaaaaa")
#
#     def start(self):
#         self.thread.start()
#
#
# if __name__ == '__main__':
#     tCraBrowser().start()
